﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EasyLib.Extensions
{
    public static class InExtensions
    {
        /// <summary>
        /// <code>
        ///bool b1 = 1.In(1, 2, 3, 4, 5);
        ///bool b2 = 1.In(1, 2, 3, 4, 5, 5, 7, 8);
        ///bool b3 = "Tom".In("Bob", "Kitty", "Tom");
        ///bool b4 = "Tom".In("Bob", "Kitty", "Tom", "Jim");
        /// </code>
        /// </summary>
        public static bool In<T>(this T tData, params T[] paramList)
        {
            return paramList.Any(p => p.Equals(tData));
        }
    }
}
